home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / Dashboard2.lha / Dashboard2 / AmiTCP / Thor / rexx / Log2Info.br
Text File  |  1998-02-26  |  2KB  |  62 lines

  1. /*
  2. $VER: Log2Info 1.0 (13.2.97)
  3. (c)  Neil Bothwick <neil@wirenet.co.uk> 1997
  4. */
  5.  
  6. /* Adds the contents of a temporary logfile      */
  7. /* to the Information conference                 */
  8.  
  9. /* Set ConnectTHOR of Get/SendTCP to log to the file       */
  10. /* specified in InfoLog. If you also want the information  */
  11. /* logged to a permanent file, specify the name in MainLog */
  12.  
  13. MainLog     = 'UUSpool:Connect.log' /* Name of main logfile to copy to, leave blank if you don't want a copy */
  14. InfoLog     = 'UUSpool:Info.log'    /* Temporary logfile to be added to Information conference */
  15. System      = 'Wirenet'             /* The system containing your information conference */
  16. Conf        = 'Information'         /* The name of your information conference */
  17. ShowStartup = 0                     /* Set to 1 to show Startup/Exit messages */
  18.  
  19. /* Don't change anything below here */
  20.  
  21. options results
  22. address command
  23.  
  24. if ~exists(InfoLog) then exit
  25.  
  26. /* Load bbsread.library if necessary */
  27. if ~show('p', 'BBSREAD') then do
  28.     address command
  29.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  30.     "WaitForPort BBSREAD"
  31.     end
  32.  
  33. /* Copy temporary log contents to main logfile */
  34. /* moved to ShowLog
  35. if symbol('MainLog') = 'VAR' & MainLog > '' then 'type' InfoLog '>>'MainLog
  36. */
  37.  
  38. if ~open(log,InfoLog,'R') then exit
  39. drop MsgData.
  40. MsgData.TEXT.COUNT = 0
  41. body = ''
  42.  
  43. /* Read log file */
  44. do while ~eof(log)
  45.     line = readln(log)
  46.     if ShowStartup = 0 & (word(line,3) = 'STARTUP' | word(line,3) = 'EXIT') then iterate
  47.     MsgData.TEXT.COUNT = MsgData.TEXT.COUNT + 1
  48.     interpret 'MsgData.TEXT.'MsgData.TEXT.COUNT '= line'
  49.     end
  50. call close(log)
  51.  
  52. /* Write message to conference */
  53. address BBSREAD
  54. MsgData.FROMNAME = 'Log2Info'
  55. MsgData.SUBJECT = 'Log information'
  56. 'WRITEBRMESSAGE "'System'" "'Conf'" stem MSGDATA'
  57. if RC > 0 then say BBSREAD.LASTERROR
  58.  
  59. address command
  60. 'delete >NIL:' InfoLog
  61.  
  62.